<div class="sidebar" id="sidebar">
    <script type="text/javascript">
        try {
            ace.settings.check('sidebar', 'fixed')
        } catch (e) {
        }
    </script>
    <?php
    $a_menu_user1 = array("useradd", "userlist");

    $user_list = Controller_Helper_Authentication::check_permission_admin('admin', 'user', 'list');
    $user_add = Controller_Helper_Authentication::check_permission_admin('admin', 'user', 'add');

    $group_add = Controller_Helper_Authentication::check_permission_admin('admin', 'group', 'add');
    $group_list = Controller_Helper_Authentication::check_permission_admin('admin', 'group', 'list');
    ?>
    <div class="sidebar-shortcuts" id="sidebar-shortcuts">

        <div class="sidebar-shortcuts-mini" id="sidebar-shortcuts-mini">
            <span class="btn btn-success"></span>

            <span class="btn btn-info"></span>

            <span class="btn btn-warning"></span>

            <span class="btn btn-danger"></span>
        </div>
    </div><!-- #sidebar-shortcuts -->

    <ul class="nav nav-list">
        <li>
            <a href="<?= URL::base() . "admin" ?>">
                <i class="icon-dashboard"></i>
                <span class="menu-text"> Dashboard </span>
            </a>
        </li>
        <?php
        if ($user_list || $user_add) {
            ?>
            <li class="<?= in_array($active_menu_left, $a_menu_user1) ? 'active open' : '' ?>">
                <a href="#" class="dropdown-toggle">
                    <i class="icon-desktop"></i>
                    <span class="menu-text">People</span>

                    <b class="arrow icon-angle-down"></b>
                </a>
                <ul class="submenu">

                    <?php if ($user_list) {
                        ?>
                        <li class="<?= $active_menu_left == 'userlist' ? 'active open' : '' ?>">
                            <a href="<?= URL::base() . "admin/user/list?act=0" ?>" >
                                <i class="icon-double-angle-right"></i>
                                <i class="icon-list"></i>
                                List

                            </a>
                        </li>
                    <?php } ?>
                    <?php
                    if ($user_add) {
                        ?>

                        <li class="<?= $active_menu_left == 'useradd' ? 'active open' : '' ?>">
                            <a href="<?= URL::base() . "admin/user/add" ?>" >
                                <i class="icon-double-angle-right"></i>
                                <i class="icon-plus"></i>   
                                Add

                            </a>
                        </li>
                    <?php } ?>

                    <?php
                    if ($user_add) {
                        ?>

                        <li class="<?= $active_menu_left == 'useradd' ? 'active open' : '' ?>">
                            <a href="<?= URL::base() . "admin/user/import" ?>" >
                                <i class="icon-double-angle-right"></i>
                                <i class="icon-plus"></i>   
                                Import

                            </a>
                        </li>
                    <?php } ?>

                </ul>
            </li>
        <?php } ?>
        <!-- Begin Group --> 
        <?php if (($group_list || $group_add) && false) { ?>
            <li class="<?= in_array($active_menu_left, array('group', 'grouplist', 'groupadd', 'groupedit')) ? 'active open' : '' ?>">
                <a href="javascript:;" class="dropdown-toggle">
                    <i class="icon-desktop"></i>
                    <span class="menu-text">Group</span>

                    <b class="arrow icon-angle-down"></b>
                </a>
                <ul class="submenu">

                    <?php if ($group_list) { ?>
                        <li class="<?= $active_menu_left == 'grouplist' ? 'active open' : '' ?>">
                            <a href="<?= URL::base() . "admin/group/list" ?>" >
                                <i class="icon-double-angle-right"></i>
                                <i class="icon-list"></i>   
                                List

                            </a>
                        </li>
                    <?php } ?>
                    <?php if ($group_add) { ?>
                        <li class="<?= $active_menu_left == 'groupadd' ? 'active open' : '' ?>">
                            <a href="<?= URL::base() . "admin/group/add" ?>" >
                                <i class="icon-double-angle-right"></i>
                                <i class="icon-plus"></i>   
                                Add

                            </a>
                        </li>
                    <?php } ?>
                </ul>
            </li>
        <?php } ?>
        <li class="<?= in_array($active_menu_left, array('newsadd', 'newsedit', 'newslist')) ? 'active open' : '' ?>">
            <a href="javascript:;" class="dropdown-toggle">
                <i class="icon-desktop"></i>
                <span class="menu-text">News</span>

                <b class="arrow icon-angle-down"></b>
            </a>
            <ul class="submenu">

                <?php if ($group_list) { ?>
                    <li class="<?= $active_menu_left == 'newsedit' || $active_menu_left == 'newslist' ? 'active open' : '' ?>">
                        <a href="<?= URL::base() . "admin/news/list" ?>" >
                            <i class="icon-double-angle-right"></i>
                            <i class="icon-list"></i>   
                            List

                        </a>
                    </li>
                <?php } ?>
                <?php if ($group_add) { ?>
                    <li class="<?= $active_menu_left == 'newsadd' ? 'active open' : '' ?>">
                        <a href="<?= URL::base() . "admin/news/add" ?>" >
                            <i class="icon-double-angle-right"></i>
                            <i class="icon-plus"></i>   
                            Add

                        </a>
                    </li>
                <?php } ?>
            </ul>
        </li>
        <li class="<?= in_array($active_menu_left, array('eventadd', 'eventlist')) ? 'active open' : '' ?>">
            <a href="javascript:;" class="dropdown-toggle">
                <i class="icon-desktop"></i>
                <span class="menu-text">Event</span>

                <b class="arrow icon-angle-down"></b>
            </a>
            <ul class="submenu">

                <?php if ($group_list) { ?>
                    <li class="<?= $active_menu_left == 'eventlist' ? 'active open' : '' ?>">
                        <a href="<?= URL::base() . "admin/event/list" ?>" >
                            <i class="icon-double-angle-right"></i>
                            <i class="icon-list"></i>   
                            List

                        </a>
                    </li>
                <?php } ?>
                <?php if ($group_add) { ?>
                    <li class="<?= $active_menu_left == 'eventadd' ? 'active open' : '' ?>">
                        <a href="<?= URL::base() . "admin/event/add" ?>" >
                            <i class="icon-double-angle-right"></i>
                            <i class="icon-plus"></i>   
                            Add

                        </a>
                    </li>
                <?php } ?>
            </ul>
        </li>

    </ul><!-- /.nav-list -->

    <div class="sidebar-collapse" id="sidebar-collapse">
        <i class="icon-double-angle-left" data-icon1="icon-double-angle-left" data-icon2="icon-double-angle-right"></i>
    </div>

    <script type="text/javascript">
        try {
            ace.settings.check('sidebar', 'collapsed')
        } catch (e) {
        }
    </script>
</div>